namespace ClassyBlog.Infrastructure
{
    using System;
    using System.Collections.Generic;
    using System.Web.Mvc;

    public class DefaultDependencyResolver : IDependencyResolver
    {
        public DefaultDependencyResolver(IServiceContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            Container = container;
        }

        protected IServiceContainer Container { get; private set; }

        public virtual object GetService(Type serviceType)
        {
            return Container.Resolve(serviceType);
        }

        public virtual IEnumerable<object> GetServices(Type serviceType)
        {
            yield break;
        }
    }
}